<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>

<script type="text/javascript">
function initXMLHttpClient() 
{
    var xmlhttp;
    try {
        // Mozilla / Safari / IE7
        xmlhttp = new XMLHttpRequest();
    } catch (e) {
         // IE
         var XMLHTTP_IDS = new Array('MSXML2.XMLHTTP.5.0',
                                    'MSXML2.XMLHTTP.4.0',
                                    'MSXML2.XMLHTTP.3.0',
                                    'MSXML2.XMLHTTP',
                                    'Microsoft.XMLHTTP' );
       var success = false;
         for (var i=0;i < XMLHTTP_IDS.length && !success; i++) {
             try {
                  xmlhttp = new ActiveXObject(XMLHTTP_IDS[i]);
                     success = true;
               } catch (e) {}
         }
         if (!success) {
             throw new Error('Unable to create XMLHttpRequest.');
         }
    }
    return xmlhttp;
}

function sendSms()
{
	alert("click called");
	var Mobile = "971559266628";
	var Message = "Welcome !";
	var code = "0";
	var userID = "simith@smartcall.ae";
	var pwd = "sim10";
	
	var xmlData = "<?xml version='1.0' encoding='utf-8' ?> \n";
    xmlData = xmlData + "<SMS> \n";
    xmlData = xmlData + "<MobileNumber>" + Mobile + "</MobileNumber> \n";
    xmlData = xmlData + "<Message>" + Message + "</Message> \n";
    xmlData = xmlData + "<Unicode>" + code + "</Unicode> \n";
    xmlData = xmlData + "<CampaignID>DEFAULT</CampaignID> \n";
    xmlData = xmlData + "<UserID>" + userID + "</UserID> \n";
    xmlData = xmlData + "<Pwd>" + pwd + "</Pwd> \n";
    xmlData = xmlData + "</SMS>";

    alert(xmlData);

    var httpGetReq = initXMLHttpClient();
    httpGetReq.onreadystatechange =function() 
    {
		if (httpGetReq.readyState == 4) 
		{
			if (httpGetReq.status==200)
			{
				alert("Success : " + httpGetReq.responseText);
			}
			else
			{
				alert("Failure : " + httpGetReq.responseText);
			}
		}
    }

	httpGetReq.open("POST","http://www.smartcall.ae/esmsnetclientapi/submitXML.aspx",true);
	httpGetReq.setRequestHeader("Content-type", "text/plain");
	httpGetReq.send(xmlData); 
}
</script>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Send SMS </title>
</head>
<body>
<input type="submit" name="Submit" value="Send SMS" OnClick="sendSms()">
</form>
</body>
</html>